import {Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges} from '@angular/core';
import * as $ from 'jquery';
declare var laydate;
@Component({
  selector: 'date-range-picker',
  templateUrl: './date-range-picker.component.html',
  styleUrls: ['./date-range-picker.component.scss']
})
export class DateRangePickerComponent implements OnInit,OnChanges {
  @Input() public Data ='';
  @Output() changeEvent : EventEmitter<any> = new EventEmitter();
  constructor() { }
  ngOnInit() {
    let  that =this;
    laydate.render({elem: '#calendar' ,eventElem: '.date-input-icon', value: this.Data, trigger: 'click',range: '~'
      ,done: function(value, date){
        that.changeEvent.emit(value)
      }});
  }
  modelChange(){
  }
  ngOnChanges(changes: SimpleChanges): void {

  }
}
